﻿@using System.Web.UI.WebControls
@model IEnumerable<DevWeb.Biztalk.DeploymentSettings.WebUI.Models.IntegrationVersionViewModel>

@using GridMvc.Html
@helper  RenderActions(DevWeb.Biztalk.DeploymentSettings.WebUI.Models.IntegrationVersionViewModel item)
{

    @Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { @class = "btn btn-info btn-xs" })
    <br />
    @Html.ActionLink("Settings", "Index", "IntegrationVersionSetting", new { id = item.Id }, new { @class = "btn btn-info btn-xs" })
    <br />
    @Html.ActionLink("Delete", "Delete", new { item.Id }, new { @class = "btn btn-danger btn-xs" })
    <br />
    @Html.ActionLink("Deployments", "Index", "DeploymentLog", new { item.Id }, new { @class = "btn btn-info btn-xs" })
    <br />
    @Html.ActionLink("Export", "ExportToFile", new { id = item.Id }, new { @class = "btn btn-warning btn-xs", @target = "_blank" })
  
}


@{
    ViewBag.Title = "Index Integration Versions";
}

<h2>Integration Version List for Integration @ViewBag.IntegrationName</h2>



@if (Model.Count() > 0)
{
    
         
    <h3>
        Integration Info
    </h3>
    <p>
        @{
             var integrationVersionViewModel = Model.FirstOrDefault();


            if (integrationVersionViewModel != null)
            {
                <p><b>Integration Name:</b>  @integrationVersionViewModel.IntegrationName</p>
                <p><b>ProductUpgradeCode:</b>  @integrationVersionViewModel.ProductUpgradeCode</p>
            }
        }
    </p>
    <p>
        @Html.ActionLink("Create New Integrationversion", "CreateVersion", new { id = integrationVersionViewModel.IntegrationId }, new {@class="btn btn-info" })
    </p>


    @Html.Grid(Model).Named("IntegrationVersionGrid").Columns(columns =>
          {
              columns.Add(m => m.ProductId).Titled("ProductID").Filterable(true).Sortable(true);
              columns.Add(m => m.Version).Titled("Version").Filterable(true).Sortable(true);
              columns.Add(m => m.Description).Titled("Description").Filterable(true).Sortable(true);
              columns.Add().Titled("Actions").Encoded(false).Sanitized(false).RenderValueAs(m => RenderActions(m));
          }).WithPaging(20)






}
else
{
    @Html.ActionLink("Create New Integrationversion", "CreateVersion", new { id = ViewBag.integrationID }, new { @class = "btn btn-info" })
}